Skip to content

extend nvme show-topology tabular output#3228

Merged
igaw merged 2 commits intolinux-nvme:masterfrom
igaw:tabs
Apr 1, 2026
Merged

extend nvme show-topology tabular output#3228
igaw merged 2 commits intolinux-nvme:masterfrom
igaw:tabs

Conversation

@igaw
Copy link
Copy Markdown
Collaborator

@igaw igaw commented Apr 1, 2026

This patchset extends the tabular output of the "nvme show-topology"
command.

Currently, the tabular output does not display controller information
if a controller has no associated namespaces or paths. However, it is
valid for a controller within a subsystem to have no namespaces or
paths attached.

In such cases, it is still useful to display controller information
such as the controller name, transport type, address, and state,
while leaving namespace and path-related fields (e.g., nsid, nshead,
anastate, nspath) empty.

This patchset is divided into two patches, first patch extends the output
for non-multipath subsystems while the second patch extends the output for
multipath subsystems.

shroffni added 2 commits April 1, 2026 15:49
The current tabular output of show-topology command does not display a
controller if it has no associated namespaces. However, it is valid
for a controller within a subsystem to have no namespaces attached.

In such cases, it is still useful to display controller information
such as the controller name, transport type, address, and state, while
leaving the namespace-related fields (e.g., namespace and nsid) as "--".

Update the tabular output of show-topology command to include
controllers and their associated fields regardless of whether any
namespaces are present. While we are at it, also dispaly the error
message using nvme_show_error() instead of using printf().

This change applies to non-multipath subsystems. A subsequent commit
will extend this behavior to multipath subsystems.

Signed-off-by: Nilay Shroff <[email protected]>
[wagi: reformatted argument list and dropped redundant comments]
Signed-off-by: Daniel Wagner <[email protected]>
The current tabular output of the show-topology command does not
display a controller if it has no associated nvme path or namespaces.
However, it is valid for a controller within a subsystem to have no
namespaces or paths attached.

In such cases, it is still useful to display controller information
such as the controller name, transport type, address, and state, while
leaving NVMe path and namespace-related fields (e.g., nsid, nshead,
nspath, anastate etc.) as "--".

Update the tabular output of the show-topology command to include
controllers and their associated fields regardless of whether any
namespaces are present. While we are at it, also dispaly the error
message using nvme_show_error() instead of using printf().

This change applies to NVMe multipath subsystems.

Signed-off-by: Nilay Shroff <[email protected]>
[wagi: reformatted argument list and redudant comments]
Signed-off-by: Daniel Wagner <[email protected]>
@igaw
Copy link
Copy Markdown
Collaborator Author

igaw commented Apr 1, 2026

root@localhost:/home/wagi/work/nvme-cli/.build-debian# ./nvme show-topology -o tabular
nvme-subsys0 - NQN=nqn.2019-08.org.qemu:nvme-0
               hostnqn=nqn.2014-08.org.nvmexpress:uuid:a94a718e-09b2-4b5b-898a-116845846761
               iopolicy=numa

Namespace NSID Controller Trtype Address      State
--------- ---- ---------- ------ ------------ -----
 nvme0n1   1     nvme0     pcie  0000:00:05.0 live

nvme-subsys1 - NQN=nqn.io-1
               hostnqn=nqn.2014-08.org.nvmexpress:uuid:befdec4c-2234-11b2-a85c-ca77c773af36
               iopolicy=numa

NSHead  NSID NSPath    ANAState  Nodes Controller TrType Address       State
------- ---- --------- --------- ----- ---------- ------ ------------- -----
nvme1n1  1   nvme1c1n1 optimized   0     nvme1     tcp   192.168.30.30 live

@igaw igaw merged commit ce97b2d into linux-nvme:master Apr 1, 2026
28 of 29 checks passed
@igaw igaw deleted the tabs branch April 1, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants